package com.taobao.dao.impl;

import java.util.HashMap;
import java.util.Map;

import com.taobao.dao.CommonDao;
import com.taobao.dao.ExitTaskDao;
import com.taobao.pojo.Config;
import com.taobao.pojo.HttpContext;
import com.taobao.pojo.Task;

public class ExitTaskDaoImpl extends CommonDao implements ExitTaskDao {

    @Override
    public Object process(HttpContext context) throws Exception {
        return context.getHtml();
    }

    @Override
    public String exitTask(Task task) throws Exception {
        Map<String, String> params = new HashMap<String, String>();
        params.put("action", "ExitTask");
        params.put("paramValue", task.getId() + "");
        return (String) postRequest(Config.url + "TasksDo.aspx", Config.url + "Tasks.aspx?t=1&jorf=j", params);
    }

}
